﻿using System.Drawing;
using System.Windows.Forms;

namespace YaP.Library.YapControls
{
    public class SideBarRenderer : ToolStripSystemRenderer
    {
        protected override void OnRenderSplitButtonBackground(ToolStripItemRenderEventArgs e)
        {
            //base.OnRenderSplitButtonBackground(e);
            e.Item.Size = new Size(e.Item.Size.Width, System.Convert.ToInt32((e.Item.Height*0.75)));
            base.OnRenderSplitButtonBackground(e);
        }

        protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
        {
            //base.OnRenderToolStripBorder(e);
            ControlPaint.DrawBorder3D(e.Graphics, e.AffectedBounds, Border3DStyle.Adjust);
        }

        protected override void OnRenderButtonBackground(ToolStripItemRenderEventArgs e)
        {
            base.OnRenderButtonBackground(e);
        }

        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            ToolStripSeparator sep = e.Item as ToolStripSeparator;

            Pen dpen = new Pen(SystemBrushes.ControlDark);
            e.Graphics.DrawLine(dpen, new Point(System.Convert.ToInt32(e.Item.Width/2), 7),
                                new Point(System.Convert.ToInt32(e.Item.Width/2), 25));
        }
    }
}